package com.ruoyi.clf.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.time.LocalDateTime; // 或根据实际日期类型调整

@AllArgsConstructor
@NoArgsConstructor
@Data
@Document(indexName = "evaluate") // 必须与 ES 索引名一致
public class Evaluate2 { // 类名改为 Evaluate2

    // 主键（可选，ES 会自动生成文档 ID，若需自定义可通过 @Id 注解）
     @Id
    // private String esId; // 对应索引中的 "esId" 字段（若有）


    @Field(name = "id", type = FieldType.Long)
    private Long id;

    @Field(name = "merchant_id", type = FieldType.Long)
    private Long merchantId; // 字段名映射：Java 驼峰命名 vs ES 下划线命名

    @Field(name = "rate", type = FieldType.Long)
    private Long rate;

    // 处理日期字段（@timestamp 和 time）
    @Field(name = "@timestamp", type = FieldType.Date)
    private LocalDateTime timestamp; // 或 Date 类型

    @Field(name = "time", type = FieldType.Date)
    private LocalDateTime time; // 或 Date 类型

    // 其他字段（text 类型需注意是否需要分词，keyword 类型用于精确匹配）
    @Field(name = "content", type = FieldType.Text)
    private String content;

    @Field(name = "imgs", type = FieldType.Text)
    private String imgs;

    @Field(name = "name", type = FieldType.Text)
    private String name;

    @Field(name = "order_id", type = FieldType.Text)
    private String orderId;

    @Field(name = "status", type = FieldType.Long)
    private Long status;

    @Field(name = "tags", type = FieldType.Text)
    private String tags;

    @Field(name = "user_id", type = FieldType.Long)
    private Long userId;

    // 构造方法、Getter 和 Setter 省略
}